home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / libg_261.zip / libg_261 / libg++ / tests / tString.exp < prev    next >
Text File  |  1994-06-15  |  1KB  |  51 lines

  1. an empty String:
  2. A string initialized to Hello:Hello
  3. A string initialized to previous string:Hello
  4. A string initialized to previous string.at(1, 2):el
  5. A string initialized to @:@
  6. A string initialized to dec(20):20
  7. n = 20 atoi(n) = 20 atof(n) = 20
  8. z = x + y = Helloworld
  9. x += y; x = Helloworld
  10. y.prepend(x); y = Helloworld
  11. cat(x, y, x, x); x = HelloworldHello
  12. cat(y, x, x, x); x = worldHelloHello
  13. z = x + s +  + y.at(w) + y.after(w) + . = Hello, world.
  14. ch = x[0] = H
  15. z = x.at(2, 3) = llo
  16. x.at(2, 2) = r; x = Hero
  17. x.at(0, 1) = j; x = jello
  18. x.at(He) = je; x = jello
  19. x.at(l, -1) = i; x = Helio
  20. z = x.at(r) = ello
  21. z = x.before(o) = Hell
  22. x.before(ll) = Bri; x = Brillo
  23. z = x.before(2) = He
  24. z = x.after(Hel) = lo
  25. x.after(Hel) = p; x = Help
  26. z = x.after(3) = o
  27. z =   a bc; z = z.after(RXwhite); z =a bc
  28. x.gsub(l, ll); x = Hellllo
  29. x.gsub(r, ...); x = Hello should have been replaced by this string
  30. x.gsub(RXwhite, #); x = Hello#should#have#been#replaced#by#this#string
  31. z = x+y; z.del(loworl); z = Held
  32. reverse(x) = olleH
  33. x.reverse() = olleH
  34. upcase(x) = HELLO
  35. downcase(x) = hello
  36. capitalize(x) = Hello
  37. capitalize(z) = He Asked:'This Is Nathan's Book?'. 'No, It's Not',I Said.
  38. z = replicate(*, 10) = **********
  39. z = This string    has
  40. five words
  41. from split(z, RXwhite, w, 10), n words = 5:
  42. This
  43. string
  44. has
  45. five
  46. words
  47. z = join(w, nw, /); z =This/string/has/five/words
  48. enter a word:word =abcdefghijklmnopqrstuvwxyz length = 26
  49.  
  50. End of test
  51.